<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <!-- <script>
        let thr = new XMLHttpRequest()
        thr.open('get', 'http://127.0.0.1:3001/getHeroList')
        thr.onload = function () {
            let arr = JSON.parse(thr.responseText)
            console.log(arr);
        }
        thr.send()
    </script> -->
    <script>
        let url = 'http://127.0.0.1:3001/getHeroList'
        let mz = { heroName: '程咬金' }
        let usp = new URLSearchParams(mz)
        let query = '?' + usp.toString();
        let xhr = new XMLHttpRequest()
        xhr.open('get', url + query)
        xhr.onload = function () {
            console.log(xhr.responseText)
        }
        xhr.send()


    </script>
</body>

</html>